import os

srcCount = 0
testCount = 0

for root, dirs, files in os.walk('.'):
    for file in files:
        if not file.endswith(".go"):
            continue

        isTestFile = file.endswith("_test.go")

        count = 0
        with open(os.path.join(root, file)) as f:
            count = len(f.readlines())

        print(file, " [TEST] " if isTestFile else " [SRC] ", count)

        if isTestFile:
            testCount += count
        else:
            srcCount += count


print(f"testCount = {testCount}")
print(f"srcCount = {srcCount}")
print(f"total = {testCount + srcCount}")
